<form class="form-horizontal" id="winModal">
    <input id="id" name="id" type="hidden" value="${company.id!}">
    <input id="itemType" name="itemType" type="hidden" value="${itemType!}">
    <div class="alert alert-danger" style="margin-bottom: 0">
        以下信息将会打印到营业执照上，请核对无误再提交
    </div>
    <div class="fa fa-"></div>
    <div class="form-group">
        <label class="col-sm-3 control-label text-left">公司名称：</label>
        <div class="col-sm-8">
            <input name="companyName" class="form-control" type="text" placeholder="请输入公司名称" value="${company.companyName!}" required="required" readonly="readonly">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label text-left">信用编码：</label>
        <div class="col-sm-8">
            <input name="companyCode" class="form-control" type="text" placeholder="请输入统一社会信用编码" value="${company.companyCode!}" required="required">
        </div>
    </div>


    <div class="form-group">
        <label class="col-sm-3 control-label text-left">类&emsp;&emsp;型：</label>
        <div class="col-sm-8">
            <input name="certType" class="form-control" type="text" placeholder="请输入类型" value="${company.certType!}" required="required">
        </div>
    </div>


    <div class="form-group">
        <label class="col-sm-3 control-label text-left">住&emsp;&emsp;所：</label>
        <div class="col-sm-8">
            <textarea class="form-control" rows="2" name="companyAddress" placeholder="请输入住所" required="required">${company.companyAddress!}</textarea>
        </div>
    </div>


    <div class="form-group">
        <label class="col-sm-3 control-label text-left">法定代表人：</label>
        <div class="col-sm-8">
            <input name="legal" class="form-control" type="text" placeholder="请输入法定代表人" value="${legal.name!}" required="required" disabled="disabled" readonly="readonly">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label text-left">注册资本：</label>
        <div class="col-sm-8">
            <div class="input-group">
                <input name="registeredCapital" class="form-control" type="number" placeholder="请输入注册资本" value="${company.registeredCapital!}" required="required">
                <span class="input-group-addon" id="basic-addon2">万元</span>
            </div>
            <label class="control-label text text-danger font-noraml">注册资本输入数字即可，打印时会自动转换成汉字。</label>
        </div>
    </div>


    <div class="form-group">
        <label class="col-sm-3 control-label text-left">成立日期：</label>
        <div class="col-sm-8">
            <input id="foundingTime" name="foundingTime" class="form-control" type="text" placeholder="请输入成立日期" value="${company.foundingTime,'yyyy-MM-dd'}" required="required" readonly="readonly">
        </div>
    </div>


    <div class="form-group">
        <label class="col-sm-3 control-label text-left">营业期限：</label>
        <div class="col-sm-8">
            <input id="busnissTime" name="busnissTime" class="form-control" type="text" placeholder="请输入营业期限" value="长期" required="required">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label text-left">二维码链接：</label>
        <div class="col-sm-8">
                <input class="form-control" name="qrcode" id="qrcode" type="url" placeholder="请输入二维码链接地址" value="${company.qrcode!}" required="required">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label text-left">经营范围：</label>
        <div class="col-sm-8">
            <textarea class="form-control" rows="5" name="businessScope" id="businessScope" placeholder="请输入经营范围" required="required">${company.businessScope}</textarea>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label text-left">短信通知：</label>
        <div class="col-sm-8">
            <label class="control-label text text-danger font-noraml ">
                <input type="checkbox" id="sendSms" name="sendSms" value="1" checked="checked">&emsp;勾选后，将发送通知短信给本公司的法人和代办人。</label>
        </div>
    </div>


</form>
<script type="text/javascript">
    //页面JS调用
    require(['bootstrapDatepicker','bootstrapDatepickerCN'], function () {
        //时间控件
        $('#foundingTime').datepicker({
            format: "yyyy-mm-dd",
            maxViewMode: 0,
            language: "zh-CN",
            keyboardNavigation: false,
            autoclose: true,
            todayHighlight: true
        });
    });
    //验证
    $(function () {
        var e = "<i class='fa fa-times-circle'></i>";
        $("#winModal").validate({
            rules: {
                companyName: {
                    required: true,
                    rangelength: [10, 50],
                    stringZhCNName: true
                },
                companyCode: {
                    required: true
                },
                certType: {
                    required: true
                },
                companyAddress: {
                    required: true
                },
                legal: {
                    required: true
                },
                registeredCapital: {
                    required: true
                },
                qrcode: {
                    required: true
                },
                foundingTime: {
                    required: true
                },
                busnissTime: {
                    required: true
                },
                businessScope: {
                    required: true
                }
            },
            messages: {       //自定义验证消息
                companyName: {
                    required: e + "公司名称不能为空！",
                    stringZhCNName: e + "只能包含汉字。",
                    rangelength: $.validator.format(e + "公司名称要在{0}-{1}个汉字之间。")
                },
                companyCode: {
                    required: e + "统一社会信用编码不能为空！"
                },
                certType: {
                    required: e + "公司类型不能为空！"
                },
                companyAddress: {
                    required: e + "公司住所不能为空！"
                },
                legal: {
                    required: e + "法人不能为空！"
                },
                qrcode: {
                    required: e + "营业执照的二维码链接不能为空！",
                    url: e + "二维码链接地址错误"
                },
                registeredCapital: {
                    required: e + "注册资本不能为空！"
                },
                foundingTime: {
                    required: e + "成立时间不能为空！"
                },
                busnissTime: {
                    required: e + "经营期限不能为空！"
                },
                businessScope: {
                    required: e + "经营范围不能为空！"
                }


            }
        });
    });
</script>